home *** CD-ROM | disk | FTP | other *** search
- /************************************************************************************************/
- /* */
- /* Module Name: SetDNProgressDet */
- /* */
- /* File Name: SetDNProgressDet.c */
- /* */
- /* © Apple Computer, Inc. 1994-1995 */
- /* All Rights Reserved */
- /* */
- /* Revision History: */
- /* */
- /* Date Who Modification */
- /* */
- /* 1994-11-07 Jaakko Railo Original version */
- /* */
- /************************************************************************************************/
-
- /****************************************** DESCRIPTION ******************************************
-
- *************************************************************************************************/
-
- /******************************************** HEADERS *******************************************/
-
- #ifndef __TELEPHONES__
- #include "Telephones.h"
- #endif
-
- #include "TestModule.h"
-
- /****************************************** DEFINITIONS *****************************************/
-
- #define rDisplayProgressDetDLOG 10000
- #define kProgressDetOnItem 2
- #define kProgressDetOffItem 3
- #define kProgressDetOn 1
- #define kProgressDetOff 0
-
- /****************************************** PROTOTYPES ******************************************/
-
- short DisplaySetDNProgressDet (void);
- void DoTest (CHRSPtr paramPtr);
-
- /************************************************************************************************/
- /************************************************************************************************/
-
-
- pascal short TestModule (CHRSPtr paramPtr)
- {
- short returnValue = noErr;
-
- if (paramPtr->version <= kTestModuleVersion) {
-
- DoTest (paramPtr);
-
- }
- else
- returnValue = kWrongVersion;
-
- return (returnValue);
- }
-
-
- short DisplaySetDNProgressDet (void)
- {
- short itemHit;
- DialogPtr theDialog;
-
- if ((theDialog = GetNewDialog (rDisplayProgressDetDLOG, nil, (WindowPtr)(-1L))) != nil) {
-
- ShowWindow (theDialog);
-
- ModalDialog (nil, &itemHit);
-
- DisposeDialog (theDialog);
- }
- else
- itemHit = -1;
-
- return (itemHit);
- }
-
-
- void DoTest (CHRSPtr paramPtr)
- {
- TELHandle termHand = GetCurrentTELHandle (paramPtr);
- TELDNHandle dnHand;
- short itemHit;
- OSErr errCode;
- long selector = nil;
- Boolean progressDet;
-
- if ((dnHand = GetDNHandle (paramPtr)) != nil) {
- itemHit = DisplaySetDNProgressDet ();
- if ((itemHit == kProgressDetOnItem) || (itemHit == kProgressDetOffItem)) {
-
- progressDet = (itemHit == kProgressDetOnItem)?kProgressDetOn:kProgressDetOff;
-
- if ((errCode = TELSetDNProgressDet (dnHand, selector, progressDet)) == noErr)
- Print (paramPtr, "TELSetDNProgressDet --> Progress Detect = %s",
- ((progressDet==kProgressDetOn)?"ProgressDetOn":"ProgressDetOff"));
- else
- Print (paramPtr, "### TELSetDNProgressDet failed : %d", errCode);
- }
- else
- if (itemHit == -1)
- Print (paramPtr, "### Unable to get a DLOG resource");
- }
- else
- Print (paramPtr, "### Unable to retrieve the DN handle");
- }
-
-
-